package com.swings.builder;

import java.util.List;

import org.apache.log4j.Logger;

import com.swings.componants.FormComponent;

/**
 * <p>
 * <b>Overview:</b>
 * <p>
 * 
 * 
 * <pre>
 * Creation date: Feb 16, 2015
 * @author Amit Kshirsagar
 * @version 1.0
 * @since
 * 
 * <p><b>Modification History:</b><p>
 * 
 * 
 * </pre>
 */

public class FormBuilder extends JComponantBuilder {
	static Logger log = Logger.getLogger(FormBuilder.class.getName());

	public static List<FormComponent> getFormComponentsForPanel(String panel) {
		if (application == null) {
			parseDom2Componants();
		}
		List<FormComponent> formComponentList = null;
		for (int i = 0; i < application.getFrame().getPanel().size(); i++) {
			if (application.getFrame().getPanel().get(i).getPanelName().equalsIgnoreCase(panel)
					&& application.getFrame().getPanel().get(i).getSubPanelName().equalsIgnoreCase("FormPanel")) {
				formComponentList = application.getFrame().getPanel().get(i).getFormComponent();
			}

		}
		return formComponentList;
	}

	public static void main(String[] args) {
		FormBuilder.parseDom2Componants();
	}

}
